package cn.sy.service.impl;

import cn.sy.domain.ProductionDetailed;
import cn.sy.mapper.ProductionDetailedMapper;
import cn.sy.service.IProductionDetailedService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author director
 * @since 2022-12-08
 */
@Service
public class ProductionDetailedServiceImpl extends ServiceImpl<ProductionDetailedMapper, ProductionDetailed> implements IProductionDetailedService {
    @Resource
    private ProductionDetailedMapper productionDetailedMapper;

    @Override
    public ProductionDetailed selectByProductionId(Long id) {
        return productionDetailedMapper.selectByProductionId(id);
    }

    @Override
    public ProductionDetailed selectByOrderRef(String orderRef) {
        Wrapper<ProductionDetailed> wrapper = new EntityWrapper<>();
        wrapper.eq("order_ref", orderRef);
        return selectOne(wrapper);
    }
}
